package com.whcoding.designpatterns.pattern.chainofresponsibility.validate;

import com.whcoding.designpatterns.pattern.chainofresponsibility.handler.LoginHandler;
import com.whcoding.designpatterns.pattern.chainofresponsibility.vo.UserVO;

/**
 * @program: spring-boot-learning
 * @description: 具体处理者
 * @author: whcoding
 * @create: 2022-09-19 14:32
 **/
public class ValidateAuthHandler extends LoginHandler {

	@Override
	public void doHandler(UserVO userVO) {
		if (!"管理员".equals(userVO.getRoleName())) {
			System.out.println("您不是管理员，没有操作权限");
			return;
		}
		if (null != next) {
			next.doHandler(userVO);
		}
	}


}
